$scope.getAPI= function(pageSize, page) {
setTimeout(function() {
var url=base+'/api.server.com/xxxx/sc/commodity/getxxxxx';
$http(
{method:'POST',
url,
data: {'grant_type':'client_credentials'},
data: {'Id': '1020xx','limit':1000,'page':1},
status
}).success(function(largeLoad) {
$scope.setPagingData(largeLoad, page, pageSize);
}).error(function(largeLoad,status){
console.log('error'+status)
})
}, 100);
};
$scope.setPagingData = function(dt, page, pageSize) {
//将对象转换为数组
var arry = $.map((dt),function(value,index){
return [value]
})
arry = arry.slice(1)
var arr = []
for(i = 0;i<arry.length;i++){
arr = arry[i]
}
arry = $.map((arr),function(value,index){
return [value]
})
var pagedData = arry[0].slice((page - 1) * pageSize, page * pageSize);
$scope.ports = pagedData;
$scope.totalServerItems = dt.length;
if (!$scope.$$phase) {
$scope.$apply();
}
};
$scope.pagingOptions = {
pageSizes: [15, 30, 45],
pageSize: 15,
currentPage: 1
};
$scope.getAPI();//main方法调用
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。